import request from '@/utils/request'
const API_BASE_URL = process.env.BASE_API

// 导出题库题目模板
export const downloadTemplate = `${API_BASE_URL}/question/downLoadQueTel`
// 导入题库题目文件
export const importExcel = `${API_BASE_URL}/question/importQueV2`

export function add(data) {
  return request({
    url: 'question/addOrUpdateBank',
    method: 'post',
    data
  })
}
//删除题库、题目、选项
export function del(id) {
  return request({
    url: 'question/deleteBank/' + id,
    method: 'post'
  })
}
//删除题目和选项
export function deleteBankQuesAndOption(id) {
  return request({
    url: 'question/deleteBankQuesAndOption/' + id,
    method: 'post'
  })
}
//删除选项
export function delBankQuesOption(id) {
  return request({
    url: 'question/deleteBankQuesOption/' + id,
    method: 'post'
  })
}

export function queList(params) {
  return request({
    url: 'question/que-List',
    method: 'get',
    params
  })
}
export function addQuestion(data) {
  return request({
    url: 'question/addOrUpdateQueAndOpt',
    method: 'post',
    data
  })
}

export function exportBank(params) {
  return request({
    url: 'question/exportQueV2',
    method: 'get',
    responseType: 'blob',
    params
  })
}

export function downLoadQueTel() {
  return request({
    url: 'question/downLoadQueTel',
    method: 'get',
    responseType: 'blob',
  })
}
